package book;

import book.Book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 沈明月
 * Date: 2023-06-29
 * Time: 18:42
 */
public class BookList {
    private Book[] books = new Book[10];
    private int usedSize;//计数器  记录放了几本书

    public BookList(){
        //构造方法来初始化成员
        this.books[0] = new Book("三国演义","罗贯中","小说",35);
        this.books[1] = new Book("红楼梦","曹雪芹","小说",32);
        this.books[2] = new Book("西游记","吴承恩","小说",34);
        this.usedSize = 3;
    }

    public Book getBook(int pos){
        return books[pos];
    }

    public void setBooks(int pos, Book book){
        books[pos] = book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
